import java.util.*;

public class PersonTest 
{
	public static void main(String[] args)
	{
		Student[] p = new Student[2];
		p[0] = new Student("aSting", "Computer");
		p[1] = new Student("Carry", "Compute");
		
		Arrays.sort(p);
		
		for(Student man:p)
		{
			System.out.println(man.getName() + ", " + man.getMajor());
			//System.out.println(man.getClass());
		}
	}
}

abstract class Person implements Comparable<Object>
{
	public Person(String n)
	{
		name = n;
	}
	
	public String getName()
	{
		return name;
	}
	
	public int compareTo(Object other)
	{
		Person ot = (Person) other;
		if (name.hashCode() > ot.name.hashCode()) return 1;
		if (name.hashCode() < ot.name.hashCode()) return -1;
		return 0;
	}
	
	public abstract String getDescription();
	
	protected String name;
}

class Student extends Person
{
	public Student(String n, String m)
	{
		super(n);
		major = m;
	}
	
	public String getDescription()
	{
		return "The person is a Student";
	}
	
	public String getMajor()
	{
		return major;
	}

	public int compareTo(Object other)
	{	
		Student ot = (Student) other;
		if (major.hashCode() > ot.major.hashCode()) return 1;
		if (major.hashCode() < ot.major.hashCode()) return -1;
		return 0;
	}
	
	private String major;


	
}